package com.nt.train.service.impl;

import com.nt.train.dto.PageVo;
import com.nt.train.service.BaseService;

import java.util.List;
import java.util.Map;

/**
 * @author hlf
 * @version 1.0
 * @date 2022/7/31 15:46
 */
public class BaseServiceImpl<T> implements BaseService<T> {

    /**
     * 注入BaseDao
     */
//    @Autowired
//    protected BaseDao<T> baseDao;

    @Override
    public Integer saveBackId(T bean) {
       // return baseDao.saveBackId(bean);
        System.out.println("新增成功");
        return 0;
    }

    @Override
    public void save(T bean) {
        System.out.println("新增成功");
       // baseDao.saveBackId(bean);
    }

    @Override
    public void update(T bean) {
        System.out.println("修改成功");
        //baseDao.update(bean);
    }

    @Override
    public void update(T bean, String... wheres) {
        System.out.println("修改成功");
        //  baseDao.update(bean, wheres);
    }

    @Override
    public void delete(T bean) {
        System.out.println("删除成功");
        // baseDao.delete(bean);
    }

    @Override
    public void delete(T bean, String... wheres) {
        System.out.println("删除成功");
        // baseDao.delete(bean, wheres);
    }

    @Override
    public void delete(Object[] ids) {
        System.out.println("删除成功");
        // baseDao.delete(ids);
    }

    @Override
    public void delete(Object[] ids, Object... wheres) {
        System.out.println("删除成功");
      //  baseDao.delete(ids, wheres);
    }

    @Override
    public T getById(Object id) {
       // return baseDao.getById(id);
        System.out.println("查询成功");
        return null;
    }

    @Override
    public T getByParams(String field, Object parmas) {
      //  return baseDao.getByParams(field, parmas);
        System.out.println("查询成功");
        return null;
    }

    @Override
    public T getByParams(String[] fields, Object... parmas) {
     //   return baseDao.getByParams(fields, parmas);
        System.out.println("查询成功");
        return null;
    }

    @Override
    public List<Map<String, Object>> queryAll() {
       // return baseDao.queryAll();
        System.out.println("查询成功");
        return null;
    }

    @Override
    public List<Map<String, Object>> queryList(Map<String, Object> params) {
       // return baseDao.queryList(params);
        System.out.println("查询成功");
        return null;
    }

    @Override
    public List<Map<String, Object>> queryList(String field, Object params) {
       // return baseDao.queryList(field, params);
        System.out.println("查询成功");
        return null;
    }

    @Override
    public List<Map<String, Object>> queryList(String[] fields, Object... params) {
       // return baseDao.queryList(fields, params);
        System.out.println("查询成功");
        return null;
    }

    @Override
    public PageVo queryPage(int page, int rows, Map<String, Object> params) {
        //return baseDao.queryPage(page, rows, params);
        System.out.println("查询分页成功");
        return null;
    }
}
